﻿using System;
using System.Collections.Generic;
using System.Text;

namespace MediaPortal.Plugins.Trailers
{
  
  public class Trailer
  {

    public class StringList : List<string>
    {
      public override string ToString()
      {
        return ToString(", ");
      }

      /// <summary>
      /// Joins a string[] together with the the given seperator
      /// </summary>
      /// <param name="seperator"></param>
      /// <returns>string output</returns>
      public string ToString(string seperator)
      {
        return string.Join(seperator, base.ToArray());
      }
    }

    #region Enums

    public enum InfoState
    {
      INDEX,
      DETAIL
    }

    public enum TrailerType
    {
      Movie,
      Game
    }

    #endregion

    #region Variables

    private StringList _genres = new StringList();
    private StringList _cast = new StringList();
    private StringList _platforms = new StringList();
    private int _year = 0;
    public VideoCollection Media = new VideoCollection();
    
    #endregion

    #region Properties

    public string Title { get; set; }
    public string Description { get; set; }
    
    public int Year {
      get {
        if (_year > 0)
        {
          return _year;
        }
        else
        {
          return ReleaseDate.Year;
        }
      }
      set { _year = value; }
    }
    public DateTime ReleaseDate { get; set; }
    public int Runtime { get; set; }
    public string Director { get; set; }
    public string Rating { get; set; }
    public string Studio { get; set; }
    public string Poster { get; set; }
    public string Thumb { get; set; }
    public object Tag { get; set; }
    public InfoState State { get; set; }
    public TrailerType Type { get; set; }

    public StringList Genres
    {
      get { return _genres; }
      set { _genres = value; }
    }

    public StringList Platforms {
      get { return _platforms; }
      set { _platforms = value; }
    }

    public StringList Cast
    {
      get { return _cast; }
      set { _cast = value; }
    }

    #endregion

  }
}
